package de.chessgame.handler;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;
import de.chessgame.gui.GuiChessBoard;
import de.chessgame.inventory.ContainerChessBoard;
import de.chessgame.tileentity.TileEntityChessBoard;

public class ChessGameGuiHandler implements IGuiHandler {

	public static final int CHESS_BOARD = 0;

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world,
			int x, int y, int z) {

		TileEntityChessBoard tileEntityChessTable = (TileEntityChessBoard) world
				.getTileEntity(x, y, z);
		switch (ID) {
		case CHESS_BOARD:
			return new ContainerChessBoard(player, tileEntityChessTable);

		default:
			return null;
		}
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world,
			int x, int y, int z) {
		TileEntityChessBoard tileEntityChessTable = (TileEntityChessBoard) world
				.getTileEntity(x, y, z);
		switch (ID) {
		case CHESS_BOARD:
			return new GuiChessBoard(player, tileEntityChessTable);

		default:
			return null;
		}
	}
}
